import { DataTypes } from 'sequelize'
import { sequelize } from '../db/sequelize.js'

export const Book = sequelize.define('books', {
    id: {
        type: DataTypes.INTEGER,
        unique: true,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
    },
    bookName: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    author: {
        type: DataTypes.STRING,
        allowNull: false
    },
    publishedAt: {
        type: DataTypes.DATE
    },
    descriptions: {
        type: DataTypes.STRING,
        allowNull: true
    }
}
)